import Mock from 'mockjs';
import { urls } from '../config';


Mock.mock(RegExp(urls.orders + ".*"), 'get', (request: any) => {

    const data = Mock.mock({
        "order|100": [
            {
                id: '@id',
                start_month_code: '@date("yyyyMM")',
                "version|1": ['幼幼版', '快乐版', '学习版'],
                "length|1": [12, 24, 36],
                "price|1-100.1-2": 1,
                "status|1": [0, 1],
                processed_at: '@datetime',
                user: '@cname',
                cellphone: /199\d{8}/,
                "type|1": ['S', 'ST', 'S2', 'K']
            }
        ]
    });

    return {
        status: 200,
        message: 'success',
        data: data.order
    };
});



Mock.mock(urls.upload, 'post', (request: any) => {
    return {
        status: 200,
        message: 'success',
        data: {
            name: 'fdsafdas',
            key: '123213123',
        }
    };
});



